package ch.jamme.conf;

/**
 * Defines the naming convention to be used while generating marshalling an object in xml
 * @author Mario Fusco
 */
public interface NamingConvention {

	/**
	 * Returns the name of the attribute that contains a value that uniquely identifies 
	 * a given marshalled object in the xml tree
	 */
	String getIdentifierAttribute();

	/**
	 * Returns the name of the attribute that contains the value of an object identifier 
	 * that references the xml of an already marshalled object
	 */
	String getIdentifierReferenceAttribute();

	/**
	 * Returns the name of the attribute that contains the class name of the marshalled object
	 */
	String getClassNameAttribute();

	/**
	 * Returns the tag name of the xml root element resulting from the marshalling of the object itself
	 * @param object The object to be marshalled
	 */
	String getRootTag(Object object);

	/**
	 * Returns the tag name of the elements resulting from the marshalling of each item of a given list
	 * @param containingClass The class of the object containing the list to be marshalled
	 * @param fieldName The name of the field containing the list
	 */
	String getListItemTag(Class<?> containingClass, String fieldName);

	/**
	 * Returns the tag name of the elements resulting from the marshalling of each entry of a given map
	 * @param containingClass The class of the object containing the map to be marshalled
	 * @param fieldName The name of the field containing the map
	 */
	String getMapItemTag(Class<?> containingClass, String fieldName);

	/**
	 * Returns the tag name of the elements resulting from the marshalling of each key of a given map
	 * @param containingClass The class of the object containing the map to be marshalled
	 * @param fieldName The name of the field containing the map
	 */
	String getMapKeyTag(Class<?> containingClass, String fieldName);
	
	/**
	 * Returns the tag name of the elements resulting from the marshalling of each value of a given map
	 * @param containingClass The class of the object containing the map to be marshalled
	 * @param fieldName The name of the field containing the map
	 */
	String getMapValueTag(Class<?> containingClass, String fieldName);
}
